package ru.compscicenter.databases.zaikina.common.commands;

public class SysCommandType {
    public static final Integer AddFiles = 0;
    public static final Integer AddWords = 1;
    public static final Integer RemoveFiles = 2;
    public static final Integer RemoveWords = 3;
    public static final Integer GetFilesByWords = 4;
    public static final Integer UpdateFiles = 5;
    public static final Integer UpdateWords = 6;
    public static final Integer GetSameWords = 7;
    public static final Integer Commit = 8;
    public static final Integer WordsAnswer = 9;
    public static final Integer FullWordsAnswer = 10;
    public static final Integer FilesAnswer = 11;
    public static final Integer MessageAnswer = 12;
    public static final Integer Error = 13;
    public static final Integer Success = 14;
    public static final Integer GetFilesByIds = 15;
    public static final Integer GetWordsWithReferences = 16;
    public static final Integer FullDocumentsAnswer = 17;
    
    public static boolean isEmptyCommand(Integer type) {
        return (type.equals(Error)) || (type.equals(Commit))
                || (type.equals(Success));
    }
    
    public static boolean isStringListCommand(Integer type) {
        return (type.equals(AddFiles)) || (type.equals(RemoveFiles))
                || (type.equals(UpdateFiles)) || (type.equals(GetSameWords))
                || (type.equals(MessageAnswer)) || type.equals(GetWordsWithReferences);
    }
    
    public static boolean isDocumentsCommand(Integer type) {
        return (type.equals(FilesAnswer));
    }

    public static boolean isWordsCommand(Integer type) {
        return (type.equals(WordsAnswer));
    }

    public static boolean isFullWordsCommand(Integer type) {
        return (type.equals(AddWords)) || (type.equals(RemoveWords))
                || (type.equals(UpdateWords)) || (type.equals(FullWordsAnswer))
                || (type.equals(GetFilesByWords));
    }

    public static boolean isFullDocumentsCommand(Integer type) {
        return (type.equals(FullDocumentsAnswer)) || (type.equals(GetFilesByIds));
    }

    public static boolean isEasyCommand(Integer type) {
        return (type.equals(GetSameWords)) || (type.equals(GetFilesByIds))
                || (type.equals(SysCommandType.GetFilesByWords))
                || (type.equals(SysCommandType.GetWordsWithReferences));
    }
}
